<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<c:set var="path" value="${pageContext.request.contextPath}"/>
<c:set var="question" value="${sessionScope.question }"/>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript">
function check(form){

	if(form.pId.value==""){
			alert("请选择套题!");
			form.subject.focus();
			return false;
	}
	if(form.subject.value==""){
		alert("请输入考试题目名称!");
		form.subject.focus();
		return false;
	}
	if(form.optionA.value==""){
		alert("请输入A选项");
		form.optionA.focus();
		return false;
	}
	if(form.optionB.value==""){
		alert("请输入B选项");
		form.optionB.focus();
		return false;
	}
	if(form.optionC.value==""){
		alert("请输入C选项");
		form.optionC.focus();
		return false;
	}
	if(form.optionD.value==""){
		alert("请输入D选项");
		form.optionD.focus();
		return false;
	}
}


</script>
</head>
<body>
<form action="updateQuestion.do" method="post" onsubmit="return check(this)">
<input name="qId" value="${question.id }" type="hidden"/>
<table width="100%"  border="0" cellpadding="0" cellspacing="0">
<tr>
    <td height="30" align="left" style="padding:5px;">所属课程：</td>
    <td align="left">
		${question.paper.lesson.name }
    </td>
</tr>
<tr>
    <td height="30" align="left" style="padding:5px;">所属套题：</td>
    <td align="left" id="whichTaoTi">
    	${question.paper.name }
    </td>
</tr>
<tr align="center">
    <td height="30" align="left" style="padding:5px;">考试题目：</td>
    <td align="left">
      	<input name="subject" value="${question.subject }"> *
	</td>
</tr>
<tr>
    <td height="30" align="left" style="padding:5px;">试题类型：</td>
    <td align="left">
    	<c:if test="${question.type=='s' }">单选题</c:if>
	 	<c:if test="${question.type=='m' }">多选题</c:if>
    </td>
</tr>	
<tr align="center">
    <td height="30" align="left" style="padding:5px;">选项A：</td>
    <td align="left">
      	<input name="optionA" value="${question.optionA }"> *
	</td>
</tr>
<tr align="center">
    <td  height="30" align="left" style="padding:5px;">选项B：</td>
    <td  align="left">
      	<input name="optionB" value="${question.optionB }"> *
	</td>
</tr>
<tr align="center">
    <td height="30" align="left" style="padding:5px;">选项C：</td>
    <td align="left">
      	<input name="optionC" value="${question.optionC }"> *
	</td>
</tr>
<tr align="center">
    <td  height="30" align="left" style="padding:5px;">选项D：</td>
    <td  align="left">
      <input name="optionD" value="${question.optionD }"> *
	  </td>
    </tr>
    
    <tr align="center">
    	<td height="30" align="left" style="padding:5px;">正确答案：</td>
    	<td align="left">
	    	<input name="answer" value="${question.answer }">
	    	*请按此格式修改
	  	</td>	
	</tr>	
	<tr>
   		<td colspan="2"><input type="submit" value="保存"/>
   		<input type="reset" value="取消"/></td>		
   	</tr>
</table>
</form>
</body>
</html>